<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Diocese extends Model
{
    use HasFactory;
    // protected $fillable = [
    //     'name', 'title', 'parish_num',
    // ];

    protected $guarded = [];

    public function province(){
        return $this->hasOne(District::class,'adcode','province_adcode');
    }

    public function cathedral(){
        return $this->belongsTo(Parish::class,'cathedral_id');
    }

    public function parishlist(){
        return $this->hasMany(Parish::class);
    }
}
